package org.ekstrabilet.main.gui.panes;

import java.awt.BorderLayout;

import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;

import org.ekstrabilet.main.gui.tabs.*;

/**
 * Administration pane GUI class.
 *
 */
public class AdminPane {
	
	private JPanel pane;
	private JTabbedPane tab;
	private AdminTab adminTab;
	private GuestTab guestTab;
	private SalesTab salesTab;
	private TechTab techTab;
	private JLabel lHello;
	
	private String login;
	
	public AdminPane() {
		adminTab = new AdminTab();
		guestTab = new GuestTab();
		salesTab = new SalesTab();
		techTab = new TechTab();
		
		tab = new JTabbedPane();
		tab.add(Panes.ADMIN, adminTab.getTab());
		tab.add(Panes.GUEST, guestTab.getTab());
		tab.add(Panes.SALES, salesTab.getTab());
		tab.add(Panes.TECH, techTab.getTab());
		
		login = "";
		lHello = new JLabel("Hello " + login + "!");
		
		pane = new JPanel(new BorderLayout(10, 10));
		pane.add(lHello, BorderLayout.NORTH);
		pane.add(tab, BorderLayout.CENTER);
	}
	
	public JPanel getPane() {
		return pane;
	}
	
	public void setLogin(String l) {
		login = l;
		lHello.setText("Hello " + login + "!");
	}
}
